﻿using System;
using System.ComponentModel.DataAnnotations;

namespace IoT3Week1.Domain
{
    /// <summary>
    /// 性别枚举
    /// </summary>
    public enum Gender
    {
        男 = 1,
        女 = 3
    }

    //练习枚举的定义
    public enum UserStatus
    {
        禁用,
        启用,
        已删除
    }


    public class User
    {
        [Key]
        public int UId { get; set; }

        [StringLength(20)]
        [Required]
        public string UserName { get; set; }

        [StringLength(50)]
        [Required]
        public string UserPass { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public Gender Sex { get; set; }

        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime RegisterTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [StringLength(20)]
        [Required]
        public string ResigterUser { get; set; }


        public UserStatus Status { get; set; }  //用户的状态

    }
}
